/**
 * 
 */
package com.zaprit.search.service;

import java.util.List;

import com.rdo.util.search.FacetedSearchCriteria;
import com.rdo.util.search.FacetedSearchResult;
import com.zaprit.search.bo.Item;
import com.zaprit.search.exception.SearchException;

/**
 * @author Root
 */
public interface SearchService
{
	/**
	 * @param scopeId
	 * @param userId
	 * @param item
	 * @throws SearchException
	 */
	public void addUpdateItem(String scopeId, String userId, Item item) throws SearchException;

	/**
	 * @param scopeId
	 * @param userId
	 * @param itemId
	 * @return Item
	 * @throws SearchException
	 */
	public Item getItem(String scopeId, String userId, String itemId) throws SearchException;

	/**
	 * @param scopeId
	 * @param userId
	 * @param attachmentId
	 * @throws SearchException
	 */
	public void triggerFileParsing(String scopeId, String userId, String attachmentId) throws SearchException;

	/**
	 * @param scopeId
	 * @param userId
	 * @param attachmentId
	 * @return Item
	 * @throws SearchException
	 */
	public Item parseFile(String scopeId, String userId, String attachmentId) throws SearchException;

	/**
	 * @param scopeId
	 * @param userId
	 * @param facetedSearchCriteria
	 * @return FacetedSearchResult
	 * @throws SearchException
	 */
	public FacetedSearchResult<List<Item>> searchItem(String scopeId, String userId, FacetedSearchCriteria<String> facetedSearchCriteria)
			throws SearchException;

	/**
	 * Builds full index
	 * 
	 * @throws SearchException
	 */
	public void rebuildIndex() throws SearchException;

	/**
	 * Builds index per scope
	 * 
	 * @param scopeId
	 * @throws SearchException
	 */
	public void rebuildIndex(String scopeId) throws SearchException;

}
